import useScroll from "@/hooks/useScroll"
export default ()=>{
 const {scrollTop}=useScroll()
 return (
  <div style={{height:'10000px'}}>
    <div style={{
       position:'fixed',
       top:'20px',
       right:'20px',
       width:'100px',
       height:'100px',
       backgroundColor:'yellow'
    }}>
    {
      scrollTop>700?<div style={{
        position:'fixed',
        top:'20px',
        width:'100px',
        marginTop:'100px',
        right:'20px',
        textAlign:'center',
        backgroundColor:'springgreen'
      }}
      onClick={()=>{
        document.documentElement.scrollTop=0
      }}>回到顶部</div>:<></>
    }    
    </div>
    
  </div>
)
}